<template>
	<view class="content-tabar">
		<view class="header">
			<view class="header-top"></view>
			<view class="flex-row header-tab flex-content-between">
				<view v-for="(item,index) in tab" class="flex-column flex-item-center" @tap="select(index)">
					<view class="header-tab-text">{{item.name}}</view>
					<view class="header-tab-text-select" v-if="selected==index"></view>
				</view>
			</view>
			<view v-if="tab[selected].data.length>0">
			<view class="bodys">
				<scroll-view scroll-y="true" class="scroll-view">
					<view class="scroll-view-goods flex-column">
						<view class="flex-row scroll-view-goods-item" v-for="it in tab[selected].data" @tap="gotopages">
							<view class="flex-column scroll-view-goods-100">
								<view class="flex-row flex-content-between">
									<view class="flex-row">
										<view class="scroll-view-goods-status"><text>堂食/自提</text></view>
										<view class="scroll-view-goods-name">辣子鸡、竹笋牛腩...</view>
									</view>
									<view class="flex-row flex-item-center">
										<view class="scroll-view-goods-state">备餐中</view>
										<image class="scroll-view-goods-img1" src="../../static/order/xiangyou.png" mode="scaleToFill"></image>
									</view>
								</view>
								<view class="scroll-view-goods-time">2022-10-02 11:26:42</view>
								<view class="scroll-view-goods-img-default">
									<scroll-view class="scroll-view-goods-scroll"  scroll-x="true">
										<view class="flex-row flex-wrap-no">
											
											<view class="scroll-view-goods-ones" v-for="item in yiges">
												<image class="scroll-view-goods-img2" src="../../static/index/lzj.png" mode="widthFix"></image>
											</view>
										</view>
									</scroll-view>
								</view>
								<view class="scroll-view-price flex-row flex-content-between flex-item-center">
									<view class="flex-row">
										<view class="scroll-view-price-jian">共6件</view>
										<view class="scroll-view-price-pr">￥321</view>
									</view>
									<view class="scroll-view-price-zailai">再来一单</view>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
				
			</view>
			<view v-if="tab[selected].data.length==0"></view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				selected:0,//选中的tab
				yiges:[
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
					'',
				],
				//所有数据
				tab:[
					{
						id:"1",
						name:"当前订单",
						page:1,
						data:[
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							"",
							"",
						]
					},
					{
						id:"1",
						name:"历史订单",
						page:1,
						data:[
							"",
							""
						]
					},
				]
			}
		},
		onLoad() {
			
		},
		methods:{
			//选中不同的tab
			select(index){
				this.selected = index
			},
			gotopages(){
				uni.navigateTo({
					url:'/pages/order/order_info'
				})
			}
		}
	}
</script>

<style lang="scss">
	.scroll-view-price{
		width: 100%;
		/* height: 50rpx; */
		/* background-color: rebeccapurple; */
		margin-top: 36rpx;
	}
	.scroll-view-price-zailai{
		width: 180rpx;
		height: 60rpx;
		background: $default-button-color;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
		opacity: 1;
		color: $default-button-foncolor;
		text-align: center;
		line-height: 60rpx;
	}
	.scroll-view-price-jian{
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
		line-height: 44rpx;
	}
	.scroll-view-price-pr{
		font-size: 32rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #333333;
		line-height: 44rpx;
	}
	.scroll-view-goods-100{
		width: 100%;
	}
	.bodys{
		width: 100%;
		margin-top: 20rpx;
	}
	.scroll-view{
		width: 100%;
		/* background-color: #FFFFFF; */
		height: calc(100vh - 180rpx - 140rpx);
		margin-left: 30rpx;
		margin-right: 30rpx;
	}
	.scroll-view-goods{
		width: 690rpx;
		// height: 340rpx;
		background-color: #FFFFFF;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		padding-bottom: 20rpx;
	}
	.scroll-view-goods-item{
		padding: 26rpx 20rpx 20rpx 26rpx;
	}
	.scroll-view-goods-status{
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: $default-button-color;
		line-height: 40rpx;
	}
	.scroll-view-goods-status>text{
		background-color: #FFECE5;
		/* padding: 3rpx; */
	}
	.scroll-view-goods-ones{
		margin-left: 20rpx;
	}
	.scroll-view-goods-name{
		font-size: 28rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-left: 6rpx;
		margin-left: 26rpx;
	}
	.scroll-view-goods-img1{
		width: 12rpx;
		height: 22rpx;
		margin-left: 16rpx;
	}
	.scroll-view-goods-img-default{
		margin-top: 22rpx;
		/* background-color: #F64B10; */
		height: 108rpx;
	}
	.scroll-view-goods-scroll{
		width: 645rpx;
	}
	.scroll-view-goods-img2{
		width: 108rpx;
		height: 108rpx;
		/* margin-left: 20rpx; */
	}
	.scroll-view-goods-time{
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
		margin-top: 6rpx;
	}
	.scroll-view-goods-state{
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
	}
	.header{
		width: 100%;
		height: 180rpx;
		background: #FFFFFF;
		border-radius: 0px 0px 0px 0px;
		opacity: 1;
	}
	.header-tab{
		/* margin-top: 114rpx; */
		margin-left: 122rpx;
		margin-right: 122rpx;
	}
	.header-top{
		width: 100%;
		height: 114rpx;
	}
	.header-tab-text{
		font-size: 34rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #333333;
	}
	.header-tab-text-select{
		width: 86rpx;
		height: 6rpx;
		background: $default-button-color;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		opacity: 1;
		margin-top: 18rpx;
	}
</style>